// @ts-nocheck

import type { MutationTree, ActionTree, GetterTree } from 'vuex'
import type { IRootState } from './index'
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { Actions, Mutations } from '@/enum/customerType'

export interface ICustomerState {
  currentCustomerId: string
  customerType: number
}

export const state: () => ISystemState = () => ({
  currentCustomerId: '',
  customerType: -1,
})

export const mutations: MutationTree<ISystemState> = {
  [Mutations.SET_CURRENT_CUSTOMER_ID](state, id) {
    state.currentCustomerId = id
  },
  [Mutations.SET_CUSTOMER_TYPE](state, id) {
    state.customerType = id
  },
}

export const actions: ActionTree<ISystemState, IRootState> = {
  // [Actions.setDepartments]({ commit }, departments) {
  //   commit(Mutations.SET_DEPARTMENTS, departments)
  // },
}

export const getters: GetterTree<ISystemState, IRootState> = {
  currentCustomerId: (state) => state.currentCustomerId,
  customerType: (state) => state.customerType,
}
